@mixin be-icon-default($color) {
  .be-icon {
    use {
      fill: $color;
    }
  }
}

@mixin be-button-type($bgColor,$textColor,$hoverColor) {
  background: $bgColor;
  color: $textColor;
  button {
    color: $textColor;
  }
  border: 0;
  &:hover {
    background: $hoverColor;
  }
}

@mixin be-button-border($bgColor,$textColor,$borderColor,$hoverBgColor,$HoverBorderColor,$hoverIconColor) {
  background: $bgColor;
  color: $textColor;
  border-color: $borderColor;
  border-width: 1px;
  button {
    color: $textColor;
  }
  &:hover {
    background: $hoverBgColor;
    border-color: $HoverBorderColor;

    .be-button-prevIcon__primary,
    .be-button-nextIcon__primary {
      .be-icon {
        use {
          fill: $hoverIconColor;
        }
      }
    }
  }
}

.be-button__inner {
  border: 0;
  outline: 0;
  cursor: pointer;
  padding: 0;
  background: transparent;
  vertical-align: bottom;
  /*  margin-left: 5px;
    margin-right: 5px;*/
}

.be-button__inner__disabled {
  cursor: not-allowed;
}

.be-button {
  border-radius: 2px;
  outline: 0;
  border: 0;
  color: white;
  display: inline-block;

  .be-button-body {
    margin: 0 auto;
    display: flex;
    justify-content: center;

    .be-button-slot {
      margin: 0 3px;
    }

    .be-button-prevIcon__error,
    .be-button-nextIcon__error,
    .be-button-prevIcon__warning,
    .be-button-nextIcon__warning,
    .be-button-prevIcon__success,
    .be-button-nextIcon__success {
      @include be-icon-default($whiteText);
    }

    .be-button-prevIcon__info,
    .be-button-nextIcon__info,
    .be-button-prevIcon__default,
    .be-button-nextIcon__default {
      @include be-icon-default($defaultText);
    }

    .be-button-prevIcon__primary,
    .be-button-nextIcon__primary {
      @include be-icon-default($primaryText);
    }

    .be-button-prevIcon {
      .be-icon {
        vertical-align: -0.1em;
      }
    }

    .be-button-nextIcon {
      .be-icon {
        vertical-align: -0.1em;
      }
    }
  }


}

.be-button__mini {
  height: 24px;
  line-height: 24px;
  padding: 0 10px;
  box-sizing: border-box;

  button {
    line-height: 24px;
  }
}

.be-button__medium {
  height: 30px;
  line-height: 30px;
  padding: 0 10px;
  box-sizing: border-box;

  button {
    line-height: 30px;
  }
}

.be-button__large {
  height: 40px;
  line-height: 40px;
  padding: 0 10px;
  box-sizing: border-box;

  button {
    line-height: 40px;
  }
}

.be-button__error {
  @include be-button-type($error, $whiteText, $errorHover);
}

.be-button__info {
  @include be-button-type($default, $defaultText, $infoHover);
}

.be-button__success {
  @include be-button-type($success, $whiteText, $successHover);
}

.be-button__warning {
  @include be-button-type($warning, $whiteText, $warningHover);
}

.be-button__primary {
  @include be-button-type($primary, $primaryText, $primaryHover);

  &:hover {
    background: $primaryHover;
    color: $whiteText;

    button {
      color: $whiteText;
    }

    .be-button-prevIcon__primary,
    .be-button-nextIcon__primary {
      .be-icon {
        use {
          fill: $whiteText;
        }
      }
    }

    border-color: $primaryText;
  }
}

.be-button__default {
  @include be-button-type($default, $defaultText, $defaultText);

  &:hover {
    color: $primaryText;

    button {
      color: $primaryText;
    }

    .be-button-prevIcon__default,
    .be-button-nextIcon__default {
      .be-icon {
        use {
          fill: $primaryText;
        }
      }
    }

    background: $primary;
  }
}


.be-button__error__border {
  @include be-button-border($error, $whiteText, $errorBorder, $errorHover, $errorHoverBorder, $whiteText);
}

.be-button__info__border {
  @include be-button-border($default, $defaultText, $infoBorder, $infoHover, $infoHoverBorder, $defaultText);
}

.be-button__success__border {
  @include be-button-border($success, $whiteText, $successBorder, $successHover, $successHoverBorder, $whiteText);
}

.be-button__warning__border {
  @include be-button-border($warning, $whiteText, $warningBorder, $warningHover, $warningHoverBorder, $whiteText);
}

.be-button__primary__border {
  @include be-button-border($primary, $primaryText, $primaryBorder, $primaryHover, $primaryHoverBorder, $whiteText);

  &:hover {
    color: $whiteText;
  }
}

.be-button__default__border {
  @include be-button-border($default, $defaultText, $infoBorder, $primary, $primaryBorder, $whiteText);

  button {
    color: $defaultText;
  }

  &:hover {
    button {
      color: $primaryText;
    }

    color: $primaryText;
  }
}

